package pay;

import java.util.Scanner;

public class Change implements PayTools{
	private double balance = 300;
	private int password = 123456;

	Scanner in = new Scanner(System.in);
	
	public void balancePay(double money) {
		System.out.println("请输入零钱密码:");
		int pw = in.nextInt();
		if(pw == password) {
			if(money <= balance) {
				balance -= money;
				System.out.println("支付成功，零钱余额为："+balance);
			}
			else {
				System.out.println("当前零钱余额为:"+balance);
				System.out.println("余额不足");
			}
		}
		else {
			System.out.println("密码错误！");
		}
	}
	
	public int getPw() {
		return password;
	}
	
	public double getBalance() {
		return balance;
	}
	
	public void setBalance(double balance) {
		this.balance = balance;
	}
	
	public void cardPay(double money) {
		
	}
}
